/*
 * main.h
 *
 *  Created on: Aug 22, 2011
 *      Author: erudhes
 */
#ifndef APP_H_
#define APP_H_
#include <wx/wx.h>

// TODO: Documentation: - Help on ultraweb
//                      - Code documentation with Javadoc
//                      - Code documentation with doc or with Wiki

namespace Configuration
{
	class Configuration;
}
class wxSocketBase;
class MainFrame;

/**
 * This class is the entry point of the application
 *
 * @author Rudolf Heszele heszele@gmail.com
 * @version 1.0
 * @since 2012-03-08
 * @see wxApp
 */
class App: public wxApp
{
	public:
		/**
		 * This method is called by the wxWidgets library when the application starts
		 *
		 * @see wxApp::OnInit
		 * @return Always return true
		 */
		virtual bool OnInit();
		/**
		 * This method is called by the wxWidgets library when the application is finished
		 *
		 * @see wxApp::OnExit
		 * @return The return value of the base class
		 */
		virtual int OnExit();
		Configuration::Configuration* getConfiguration();
		MainFrame* getMainFrame();
		wxSocketBase* getClientSocket();
		void setClientSocket(wxSocketBase* clientSocket);
		wxSocketBase* getServerSocket();
		void setServerSocket(wxSocketBase* serverSocket);
		const wxString& getActualLevel();
		void setActualLevel(const wxString& actualLevel);
		void resetActualLevel();

	private:
		Configuration::Configuration* mConfiguration;
		MainFrame* mMainFrame;
		wxSocketBase* mClientSocket;
		wxSocketBase* mServerSocket;
		wxString mActualLevel;
};

DECLARE_APP(App)

inline Configuration::Configuration* App::getConfiguration()
{
	return mConfiguration;
}

inline MainFrame* App::getMainFrame()
{
	return mMainFrame;
}

inline wxSocketBase* App::getClientSocket()
{
	return mClientSocket;
}

inline void App::setClientSocket(wxSocketBase* clientSocket)
{
	mClientSocket = clientSocket;
}

inline wxSocketBase* App::getServerSocket()
{
	return mServerSocket;
}

inline void App::setServerSocket(wxSocketBase* serverSocket)
{
	mServerSocket = serverSocket;
}

inline const wxString& App::getActualLevel()
{
	return mActualLevel;
}

inline void App::setActualLevel(const wxString& actualLevel)
{
	mActualLevel = actualLevel;
}

inline void App::resetActualLevel()
{
	mActualLevel == wxT("");
}

#endif /* APP_H_ */
